const mysql = require('mysql')
const MYSQL_CONFIG=require('./config')
const db=mysql.createPool(MYSQL_CONFIG)
function execSQL(sql, params) {
    return  new Promise((resolve, reject) => {
        db.query(sql,params, (err, result) => {
            if (err) {
                reject(err);
                return;
            }
            resolve(result);
        });
    });
}

module.exports = execSQL